﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class VauleType : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //object类型  -->Object类
        object obj = new object();
        Response.Write(obj+"<br>");//默认四obj.ToString()
        Response.Write(obj.Equals(sender) + "<br>");
        Response.Write(obj.GetHashCode() + "<br>");
        Response.Write(obj.GetType() + "<br>");
        Response.Write(obj.ToString() + "<br>");

        //string类型  -->String类
        string str1 = "abc 123 def 456";
        string[] strArray;
        strArray = str1.Split(' ');//以空格分割
        foreach (var str in strArray)//var由右边的代码决定
        {
            Response.Write(str+"<br>");
        }
        Response.Write("ABC".ToLower()+"<br>");//转换成小写
        Response.Write("中华人民共和国".Length + "<br>");

        //自定义类型类
        Book book = new Book();
        book.bookName = "平凡的世界";
        book.page = 300;
        book.price = 34.0;
        Response.Write(string.Format("{0}共{1}页{2}元<br>",    book.bookName,book.page,book.price));

        Book b2 = new Book();//指向同一内存区域
        b2.bookName = "活着";
        b2.price = 35.0;
        Response.Write(string.Format("{0}共{1}页{2}元", b2.bookName, book.page, b2.price));

    }
}
class Book
{
    public string bookName;
    public int page;
    public double price;
}